#define _CRT_SECURE_NO_WARNINGS 1
/**
 * Definition for a binary tree node.
 * struct TreeNode {
 *     int val;
 *     struct TreeNode *left;
 *     struct TreeNode *right;
 * };
 */
int sumOfLeftLeaves(struct TreeNode* root) {

	//对接收的空节点的处理
	if (root == NULL)
		return 0;

	int sum = 0;
	//1：root的左孩子存在
	//2：并且左孩子是叶子
	if (root->left && root->left->left == NULL && root->left->right == NULL)
	{   //将其值累加进sum
		sum = root->left->val;
	}

	//sum+左子树的左叶子的值+ 右子树的左叶子的值
	return sum + sumOfLeftLeaves(root->left) + sumOfLeftLeaves(root->right);
}